import Vue from 'vue'
import Router from 'vue-router'
import layout from '@/components/public/layout/layout.vue'
import login from '@/components/page/login/index.vue'
import dashboard from '@/components/page/dashboard.vue'
import accoutlist from '@/components/page/user/accout_list.vue'
import userlist from '@/components/page/user/user_list.vue'
// import autonym from '@/components/page/user/autonym.vue'
import certPerson from '@/components/page/certification/person.vue'
import certCompany from '@/components/page/certification/company.vue'
import reward from '@/components/page/reward/index.vue'
import caseDetail from '@/components/page/project_detail/index.vue'
import whole from '@/components/page/project/whole.vue'
import projectEdit from '@/components/page/project/edit.vue'
import wholeDetail from '@/components/page/project/detail.vue'
import contractDetail from '@/components/page/project/contract_detail.vue'
import rewardedit from '@/components/page/project_detail/edit.vue'
Vue.use(Router)
export default new Router({
    routes: [{
        path: '/',
        name: '首页',
        component: layout,
        redirect: '/dashboard',
        children: [{
            path: 'dashboard',
            component: dashboard
        }]
    },
    {
        path: '/login',
        name: 'login',
        component: login
    },
    {
        path: '/user',
        name: '用户中心',
        component: layout,
        redirect: '/user/accoutlist',
        children: [{
            name: '账号管理',
            path: 'accoutlist',
            component: accoutlist
        },
        // 个人实名审核
        {
            name: '用户管理',
            path: 'userlist',
            component: userlist
        },
        {
            name: '个人审核',
            path: '/user/person',
            component: certPerson
        },
        // 企业实名审核
        {
            name: '企业审核',
            path: 'company',
            component: certCompany
        }
        ]
    }, {
        path: '/project',
        name: '项目中心',
        component: layout,
        redirect: '/project/reward',
        children: [{
            name: '悬赏管理',
            path: 'reward',
            component: reward,
            meta: { keepAlive: true }
        },
        {
            path: '/project/caseDetail',
            name: '案例详情',
            component: caseDetail
        },
        {
            name: '详情编辑',
            path: '/project/whole-edit/:id',
            component: projectEdit
        },
        {
            name: '详情',
            path: '/project/whole-detail/:id',
            component: wholeDetail
        },
        {
            name: '合同信息',
            path: 'contract-detail/:id',
            component: contractDetail
        },
        // 企业实名审核
        {
            name: '整包管理',
            path: '/project/whole',
            component: whole,
            meta: { keepAlive: true }
        },
        // {
        //     name: '详情编辑',
        //     path: '/project/edit',
        //     component: projectEdit
        // },
        {
            path: '/project/rewardedit',
            component: rewardedit
        }
        ]
    }]
})

